package com.xyazm.order.domain.param;

import lombok.Data;

import java.io.Serializable;
import java.util.Objects;
import java.util.Set;

/**
 * 缺品
 * @Author: xuyou
 * @Date: 2022/7/6 15:15
 */
@Data
public class LackParam {

    /**
     * 订单号
     */
    private String orderId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 具体的缺品项
     */
    private Set<LackItemParam> lackItemList;

    /**
     * 缺品明细
     */
    @Data
    public static class LackItemParam implements Serializable {
        /**
         * sku编码
         */
        private String skuCode;

        /**
         * 缺品数量
         */
        private Integer lackNum;

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            LackItemParam that = (LackItemParam) o;
            return Objects.equals(skuCode, that.skuCode);
        }

        @Override
        public int hashCode() {
            return Objects.hash(skuCode);
        }
    }

}
